package cn.service.impl;

import cn.entity.SysResource;
import cn.entity.Transfer;
import cn.mapper.SysResourceMapper;
import cn.mapper.TransferMapper;
import cn.service.SysResourceService;
import cn.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional//开启事务
public class SysResourceServiceImpl extends BaseServiceImpl<SysResource> implements SysResourceService {
    @Autowired
    SysResourceMapper sysResourceMapper;


    @Override
    public List<SysResource> selectResourceByRid(Long id) {
        return sysResourceMapper.selectResourceByRid(id);
    }

    @Override
    @Cacheable(cacheNames = "resourceCache",key = "'SysResourceServiceImpl:selectResources'")
    public List<SysResource> selectResources() {
        return sysResourceMapper.selectResources();
    }

    @Override
    public List<String> selectResourceByUid(Long id) {
        return sysResourceMapper.selectResourceByUid(id);
    }
}
